]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[perf] Include monitor layout in performance reports
authorOwen W. Taylor <otaylor@fishsoup.net>
Tue, 18 May 2010 23:13:56 +0000 (19:13 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Fri, 21 May 2010 16:34:10 +0000 (12:34 -0400)
Add extra key, 'monitors' to performance reports which is an
array of strings:

 *<width>x<height>+<x>+<y>

Where * marks the primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=618189

js/ui/scripting.js
src/gnome-shell.in

index 07da7649d60aac1f970723edd4fcd2eff180685d..0addd54241f93e72339498bad787a1221cdc127b 100644 (file)
@@ -148,6 +148,23 @@ function _collect(scriptModule, outputFile) {
         Shell.write_string_to_stream(out, '"events":\n');
         Shell.PerfLog.get_default().dump_events(out);
 
+        let monitors = global.get_monitors()
+        let primary = global.get_primary_monitor()
+        Shell.write_string_to_stream(out, ',\n"monitors":\n[');
+        for (let i = 0; i < monitors.length; i++) {
+            let monitor = monitors[i];
+            let is_primary = (monitor.x == primary.x &&
+                              monitor.y == primary.y &&
+                              monitor.width == primary.width &&
+                              monitor.height == primary.height);
+            if (i != 0)
+                Shell.write_string_to_stream(out, ', ');
+            Shell.write_string_to_stream(out, '"%s%dx%d+%d+%d"'.format(is_primary ? "*" : "",
+                                                                       monitor.width, monitor.height,
+                                                                       monitor.x, monitor.y));
+        }
+        Shell.write_string_to_stream(out, ' ]');
+
         Shell.write_string_to_stream(out, ',\n"metrics":\n[ ');
         let first = true;
         for (let name in scriptModule.METRICS) {
index a0d23c9b529dd6fed4e86ad8f1cbdd7211f82e49..a1998c061191037ac5212929cadf8a5ae34126c9 100644 (file)
@@ -313,9 +313,10 @@ def run_performance_test():
         finally:
             os.remove(output_file)
 
-        # Grab the event definitions the first time around
+        # Grab the event definitions and monitor layout the first time around
         if i == 0:
             events = output['events']
+            monitors = output['monitors']
 
         if options.perf_warmup and i == 0:
             continue
@@ -344,6 +345,7 @@ def run_performance_test():
         report = {
             'date': datetime.datetime.now().isoformat(),
             'events': events,
+            'monitors': monitors,
             'metrics': metric_summaries,
             'logs': logs
         }